﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using CMP.ERP.Model;
using CMP.ERP.DAL;
using CMP.ERP.Helper;

namespace CMP.ERP.BLL
{
    public class SupplierBLL
    {
        //实例化SupplierDAL对象
        SupplierDAL dal = new SupplierDAL();

        /// <summary>
        /// 显示供应商信息
        /// </summary>
        /// <returns></returns>
        public DataTable SupplierAll()
        {
            return dal.SupplierAll();
        }

        /// <summary>
        /// 删除供应商v信息
        /// </summary>
        /// <param name="HB_Id"></param>
        /// <returns></returns>
        public int SupplierDelete(int id)
        {
            return dal.SupplierDelete(id); 
        }

        /// <summary>
        /// 添加供应商信息
        /// </summary>
        /// <param name="h"></param>
        /// <returns></returns>
        public int AddSupplier(Supplier s)
        {
            return dal.AddSupplier(s);
        }

        /// <summary>
        /// 根据供应商编号找到供应商信息
        /// </summary>
        /// <param name="Client_Id"></param>
        /// <returns></returns>
        public DataTable GetSupplier(int id)
        {
            return dal.GetSupplier(id);
        }

        /// <summary>
        /// 修改供应商信息
        /// </summary>
        /// <param name="client"></param>
        /// <returns></returns>
        public int UptSupplier(Supplier supplier)
        {
            return dal.UptSupplier(supplier);
        }

        /// <summary>
        /// 根据供应商名称进行查询
        /// </summary>
        /// <param name="HB_Name"></param>
        /// <returns></returns>
        public DataTable SearchSupplier(string Supplier_Name)
        {
            return dal.SearchSupplier(Supplier_Name);
        }
    }
}
